_global.Packages=new Object();

var packagePath=mlf.mcmanager.PathResolver.drawPath(this);

for (var a in this)
{
	if (typeof(this[a])=="movieclip") Packages[a]=this[a];
}

function log(mess:String, type:String)
{
	if (type=="info")
	{
		mlf.logger.Logger.info(mess);
	}
	else if (type=="debug")
	{
		mlf.logger.Logger.debug(mess);
	}
	else mlf.logger.Logger.spec(mess);
}

_global.Packages.log=log;

function focusManager()
{
	var focusListener:Object=new Object();
	focusListener.onSetFocus=function(oldFocus_txt, newFocus_txt) 
	{
		if (mlf.mcmanager.PathResolver.drawPath(oldFocus_txt).indexOf("tf_txt")>-1)
		{
			if (oldFocus_txt.htmlText=="") oldFocus_txt.htmlText=oldFocus_txt.oldHtmlText;
			oldFocus_txt.border=false;
			Packages.system.mlf.GateKeeper.dispatchMessage({type:"onTxtFocusOutEvent", param:oldFocus_txt});
		}
		if (mlf.mcmanager.PathResolver.drawPath(newFocus_txt).indexOf("tf_txt")>-1)
		{
			newFocus_txt.oldHtmlText=newFocus_txt.htmlText;
			if (newFocus_txt.type=="input")
			{
				newFocus_txt.htmlText="";
				newFocus_txt.border=true;
				newFocus_txt.borderColor=0x888888;
			}
			Packages.system.mlf.GateKeeper.dispatchMessage({type:"onTxtFocusOnEvent", param:newFocus_txt});
		}
	};
	Selection.addListener(focusListener);
}

focusManager();